package main
import(
	"fmt"
	"time"
)
const MAX int = 4000000

func main() {
	start := time.Now()
	prev := 1
	prevprev := 1
	next := prev + prevprev
	sum := next
	i := 3
	for next < MAX {
		prevprev = prev
		prev = next
		next = prevprev + prev
		if next % 2 == 0 {
			sum += next
		}
		i++
	}
	fmt.Printf("fib(%v)=%v, Sum=%v\n", i, next, sum)
	stop := time.Now()
	fmt.Printf("Execution time: %v\n", stop.Sub(start))
}
